import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import refresh from '@dfeidao/atom-web/url/refresh';

export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// todo
	const no = get(fd, "nos");
	const TypeName = fd.data.node.querySelector<HTMLInputElement>('[data-id="type_name"]')
	const TN = TypeName.value;
	if (TN === "") {
		alert("请输入完整数据");
	} else {
		const r = await nodejs<{ code: 0 | 1 }>('liuxinyu/zj-000004/s001', {
			filter: {
				plan_cla_attr_no: no,
				plan_type_name: TN,
			}
		})
		console.log(r);
		if (r.code === 1) {
			alert("新增成功")
			refresh();
		}
	}
}
